import { createContext, useContext, Context } from "react";

export interface ModalContextProps {
	redoModalHeight: () => void;
}

const ModalContext: Context<ModalContextProps | undefined> = createContext<ModalContextProps | undefined>(undefined);

export function useModalContext() {
	const context = useContext(ModalContext);
	if (context === undefined) {
		throw new Error("useModalContext must be used within a ModalContextProvider");
		return;
	}
	return context;
}
